import { request } from '@/utils/request.js';

export default {
  /**
   * 登录
   * @param {object} data
   * @returns
   */
  login(data) {
    return request({
      url: '/adminapi/auth/login',
      method: 'post',
      data: data,
    });
  },

  /**
   * 登出
   * @param {object} params
   * @returns
   */
  logout(params = {}) {
    return request({
      url: '/adminapi/auth/logout',
      method: 'post',
      data: params,
    });
  },

  /**
   * 获取登录用户信息
   * @returns
   */
  getProfile() {
    return request({
      url: '/adminapi/admin/profile',
      method: 'post',
    });
  },

  /**
   * 获取菜单
   * @returns
   */
  getMenu() {
    return request({
      url: '/adminapi/admin/menu',
      method: 'post',
    });
  },
}
